package com.danbay.cloud.account.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author SJG
 *         2018/1/9.
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AccountPermissionDto {
    /**
     * 账户id
     */
    @NotNull(message = "账户不能为空")
    private String userName;
    /**
     * 账户组id
     */
    @NotNull(message = "账户组不能为空")
    private Integer accountGroupId;
    /**
     * 账户权限
     */
    private List<Permission> permissions;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Permission {
        /**
         * 权限组id
         */
        @NotNull(message = "权限组不能为空")
        private Integer groupId;
        /**
         * 排除权限组中的某些权限,如：10,12
         */
        private String excludePermissions;
    }
}
